Repository navigation
Make IJSONServerSpec the settings shape and allow an undefined Authorization header - #367
Conversation
…tion header Types package 3.15.0-beta.1: - IJSONServerSpec describes one intersystems.servers entry: gains oauth2, loses auth - IServerSpec adds name and auth, deprecates username/password, omits oauth2 - Remove IServerSpecWithAuth; getServerSpec returns IServerSpec - ResolvedAuthorization.httpAuthorizationHeader may be undefined (UnknownUser); accessToken stays a string, empty for UnknownUser Extension: - Replace internal IServerSetting/OAuth2Config with the public types - OAuth2Authorization narrows to ResolvedOAuth2Authorization for its header - Depend on the published 3.15.0-beta.1
UnknownUserIJSONServerSpec the settings shape and allow an undefined Authorization header
|
@isc-klu will an extension that uses @intersystems-community/intersystems-servermanager version 3.14.1 continue to be able to use the public API of the Server Manager extension even after we publish Server Manager 3.15.0 on Marketplace? |
|
@gjsjohnmurray Let me know if I have misread the question. I take it as: can a client extension built against the 3.14.1 types keep working against a 3.15.0 implementation? If 3.15.0 contained only this PR, yes. The changes here are type reshaping and internal cleanup, so runtime behaviour toward clients is unchanged. I intend 3.15.0 to also include #366, which does affect clients. It makes |
|
Are you sure this change is needed? Couldn't client extensions see that username is UnknownUser and then proceed without asking server manager to resolve auth at all? |
|
Not strictly. If we accept that |
|
It might be better to return an empty string for the header and then update the main extension to set its header a different way. We need to update that anyways as part of this work. Then we don't have to publish a new types version. |
|
@isc-bsaviano Keeping the types package unchanged sounds good to me. |
Per review on intersystems-community#367 the types package stays unchanged, so ResolvedAuthorization.httpAuthorizationHeader remains a string and BasicAuthorization returns "" for UnknownUser. Clients must skip an empty header. IServerSetting is restored internally, based on IJSONServerSpec so it carries no name.
Before OAuth2 support (#335),
IJSONServerSpecdescribed one entry of theintersystems.serverssetting, andIServerSpecwas the only server type exchanged between Server Manager and other extensions. That PR added a privateIServerSettingtype to hold new OAuth2 fields, put the runtimeauthobject onIJSONServerSpec, and added a publicIServerSpecWithAuthas the return type ofgetServerSpec, so that neither type kept its original role. This PR mergesIServerSettingintoIJSONServerSpecandIServerSpecWithAuthintoIServerSpec, restoring the two original types to their long-standing roles.In addition,
ResolvedAuthorization.httpAuthorizationHeadermay now beundefined. #366 treats basic authorization with an explicitUnknownUseras resolved, and such an auth has no header to send.accessTokenstays a string, empty forUnknownUser, becausevscode.AuthenticationSession.accessTokenis typedstring.